package com.example.yjhteam.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.yjh.entity.Players;
import feign.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 选手表 Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2023-07-24
 */

public interface PlayersMapper extends BaseMapper<Players> {

    @Select("select * from players where  team_id=#{team_id}" )
    List<Players> players(@Param("team_id") int teamId);

    @Select("select p.*,t.icon  from  players p " +
            "INNER JOIN teams t on p.team_id=t.team_id " +
            "where player_id=#{player_id}")
    Map<String,Object> findOnePlayer(@Param("player_id") int playerId);

}
